package chapter10.practice2;

/**
 * 根据题目要求新建一个拥有String对象的类
 * Created by yangliwei on 2017/10/19.
 */
public class StringClass {
    private String item;

    public StringClass(String item) {
        this.item = item;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("StringClass{");
        sb.append("item='").append(item).append('\'');
        sb.append('}');
        return sb.toString();
    }

    public static void main(String[] args) {
        Sequence sequence = new Sequence(10);
        for (int i = 0; i < 10; i++) {
            sequence.add(new StringClass("shagou : "+i));
        }
        Selector selector = sequence.getSelector();
        while(selector.hasNext()){
            System.out.println(selector.current());
            selector.next();
        }
    }
}
